package com.ruoyi.web.controller.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.stereotype.Service;

@Service
public class SendMail {
    @Autowired
    private JavaMailSenderImpl javaMailSender;
    public void send(String s,String mail){
        SimpleMailMessage mailMessage = new SimpleMailMessage();
        mailMessage.setSubject("智学网验证码");
        mailMessage.setText(s);
        mailMessage.setTo(mail);
        mailMessage.setFrom("2436618557@qq.com");
        javaMailSender.send(mailMessage);
    }
}
